{extend name="public/base" /}
{block name="container"}
<body class="gray-bg">
  <div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
      <div class="col-sm-12">
        <div class="ibox float-e-margins">
          <div class="ibox-title">
            <h5>订单列表</h5>
            <div style="float: right;">
              <a  class="btn btn-w-m btn-info" href="{:url('index/folder/create')}">创建档案</a>
            </div>
          </div>
          <div class="ibox-content">
            <div class="row">
                           <!--  <div class="col-sm-5 m-b-xs">
                              <select class="input-sm form-control input-s-sm inline">
                                  <option value="0">选择品类</option>
                                  
                                  <option value=""></option>
                                 
                              </select>
                            </div>  -->
                            <!--<form action="" method="post">
                               <div class="col-sm-6 m-b-xs">
                               <div data-toggle="buttons" class="btn-group">
                                 <label class="btn btn-sm btn-white" style="width: 80px">
                                   <input type="radio" id="option1" name="options" style="width: 80px">待财审</label>
                                   <label class="btn btn-sm btn-white active" style="width: 80px">
                                     <input type="radio" id="option2" name="options" style="width: 80px">待审核</label>
                                     <label class="btn btn-sm btn-white" style="width: 80px">
                                       <input type="radio" id="option3" name="options" style="width: 80px">待定版</label>
                                       <label class="btn btn-sm btn-white" style="width: 80px">
                                         <input type="radio" id="option3" name="options" style="width: 80px">待下载</label>
                                         <label class="btn btn-sm btn-white" style="width: 80px">
                                           <input type="radio" id="option3" name="options" style="width: 80px">待发货</label>
                                           <label class="btn btn-sm btn-white" style="width: 80px">
                                             <input type="radio" id="option3" name="options" style="width: 80px">已驳回</label>     
                                           </div>
                                         </div> 
                                       </form> -->
                                       <form action="" method="post">
                                        <div class="col-sm-3" style="float: right;">
                                          <div class="input-group">
                                            <input type="text" placeholder="请输入人员姓名" name="name" class="input-sm form-control"> <span class="input-group-btn">
                                              <button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
                                            </div>
                                          </div>
                                        </form>
                                      </div>
                                      <div class="table-responsive">
                                        <table class="table table-striped">
                                          <thead>
                                            <tr>

                                              <th>序号</th>
                                              <th>姓名</th>
                                              <th>性别</th>
                                              <th>名族</th>
                                              <th>联系方式</th>
                                              <th>学历</th>
                                              <th>部门</th>
                                              <th>职位</th>
                                              <th>入职时间</th>
                                              <th>籍贯</th>
                                              <th>状态</th>
                                              <th>操作</th>

                                            </tr>
                                          </thead>
                                          <tbody>
                                           {volist name="list" id="vo"}
                                            <tr>
                                              <td>
                                                <!-- <input type="checkbox"  name="input" value=""> -->
                                                {$vo.id}
                                              </td>
                                              <td>{$vo.name}</td>
                                              <td>{if condition="$vo.sex eq 1"} 男 {else /} 女 {/if}</td>
                                              <td>{$vo.mingzu}</td>
                                              <td>{$vo.phone}</td>
                                              <td>{$vo.xueli}</td>
                                              <td>{$vo.bumen}</td>
                                              <td>{$vo.zhiwei}</td>
                                              <td>{$vo.rz_time}</td>
                                              <td>{$vo.jiguan}</td>
                                              <td>
                                                {if condition="$vo['status'] eq 1"}
                                                  <a data-toggle="modal"  href="javaScript:;" onclick="changeStatus({$vo.id},0)">
                                                  <span class="badge badge-primary">在职</span>
                                                {else /}
                                                  <a data-toggle="modal"  href="javaScript:;" onclick="changeStatus({$vo.id},1)">
                                                  <span class="badge badge-danger">离职</span></a>
                                                {/if}
                                              </td>
                                              <td>
                                                <a href="{:url('index/folder/update',array('id'=>$vo['id']))}" title="修改"><i class="fa fa-pencil-square-o"></i></a>
                                                &emsp;<a href="{:url('index/folder/show',array('id'=>$vo['id']))}" title="查看"><i class="iconfont icon-chakan"></i></a>
                                                &emsp;<a href="javascript:;" title="删除" onclick="delfolder({$vo['id']})"><i class="iconfont icon-shanchu"></i></a>
                                              </td>
                                            </tr>
                                            {/volist}
                                          </tbody>
                                        </table>
                                        <div style="float: right;">
                                        {$page}
                                       </div>
                                     </div>

                                   </div>
                                 </div>
                               </div>

                             </div>
                           </div>

                          {/block}
                          {block name="js"}
                          <!-- Peity -->
                          <script src="__INDEX__/js/plugins/peity/jquery.peity.min.js"></script>

                          <!-- 自定义js -->
                          <script src="__INDEX__/js/content.js?v=1.0.0"></script>
                          <!-- iCheck -->
                          <script src="__INDEX__/js/plugins/iCheck/icheck.min.js"></script>
                          <script>
                            $(document).ready(function () {
                              $('.i-checks').iCheck({
                                checkboxClass: 'icheckbox_square-green',
                                radioClass: 'iradio_square-green',
                              });
                            });
                          </script>

        <script>
         //修改档案状态
         function changeStatus(id,status)
         {
              swal({   
              title: "确定要修改状态?",   
              text: "确认将修改客户的状态!",   
              type: "warning",   
              showCancelButton: true,    
              confirmButtonText: "确认", 
              cancelButtonText: '取消',
              closeOnConfirm: false
            }, function(){
              $.post('/index/folder/changeStatus', {id: id,status:status}, function(data) {
                if(data.sta == -1 ){
                  swal({
                    title: "权限不足",
                    text: "",
                    type: "error"
                  });
                }else if(data.sta == 1){
                 swal({
                  title: "修改成功",
                  text: "",
                  type: "success"
                });
                 window.location.reload();
               }else{
                swal({
                  title: "修改失败",
                  text: "",
                  type: "error"
                });                
              }
              });
             });
         } 
          function delfolder(id)
          {
            swal({   
              title: "确定要删除数据?",   
              text: "确认将删除该条数据!",   
              type: "warning",   
              showCancelButton: true,    
              confirmButtonText: "确认", 
              cancelButtonText: '取消',
              closeOnConfirm: false
            }, function(){   
              $.post('{:url("index/folder/delofolder")}', {'id':id}, function(data) {
                if(data.sta == -1 ){
                  swal({
                    title: "权限不足",
                    text: "",
                    type: "error"
                  });
                }else if(data.sta == 1){
                 swal({
                  title: "删除成功",
                  text: "",
                  type: "success"
                });
                 window.location.reload();
               }else{
                swal({
                  title: "删除失败",
                  text: "",
                  type: "error"
                });                
              }
            });
            });
          }
        </script>
      </script>
      {/block}